// 柯里化案例
// "".match(/\s+/g);
// "".match(/\d+/g);

import _ from "lodash";

const match = _.curry(function (reg, str) {
  return str.match(reg);
});

const havaSpace = match(/\s+/g);
const havaNumber = match(/\d+/g);

const filter = _.curry(function (func, array) {
  return array.filter(func);
});

const findSpace = filter(havaSpace);

console.log(findSpace(["d d d", "ddd"]));
